package com.zxj.geekstudy.nio.netty;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class ServerRouter {

    public static String router(List<String> urls) {
        int index = new Random().nextInt(urls.size());
        return urls.get(index);
    }

    public static void main(String[] args) {
        List<String> urls = new ArrayList<>();
        urls.add("http1");
        urls.add("http2");
        for (int i = 0; i < 100; i++) {
            System.out.println(ServerRouter.router(urls));
        }
    }
}
